<template>
  <div>
    <div class="wr">
    <template v-for="(item, index) in list">
      <div class="page" :key="index">
        <time>
          <span class="iconfont icon-shizhong"></span>
          {{item.date}}
        </time>
        <div id="box">
          <template v-for="(list, index) in item.data">
            <div class="box" :key="index">
              <!-- <span class="iconfont icon-changyongtubiao-mianxing-"></span> -->
              <aside :title="list.content">
                <span class="span1">问题：{{list.content}}</span>
                <!-- <span class="span2">来源板块：{{list.society_name}}</span> -->
              </aside>
              <p style="color: #333333;font-size:22px" :title="list.reply">
                <span>回复：</span>
                {{list.reply}}
              </p>
            </div>
          </template>
        </div>
      </div>
    </template>
    <!-- 分页按钮 -->

    <!-- end -->
  </div>
     <div class="pages" v-if="list.length>0">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-size="pageSize"
        background
        layout="prev, pager, next"
        :total="pageall"
      ></el-pagination>
    </div>
  </div>

</template>

<script>
export default {
  components: {},
  props: {},
  data () {
    return {
      pageSize: 1,
      currentPage: 1,
      totalCount: 1,
      pageall:1,
      mData: [
        { time: '2019-10-14', shujv: [1, 2, 3, 4] },
        { time: '2019-10-14', shujv: [1, 2, 3, 4, 5] }
      ],
      num: 1019,
      list:[]
    }
  },
  computed: {},
  watch: {},
  methods: {
    getData (e) {
      let id = sessionStorage.id
      let _this = this
      this.$http({
        method: 'post',
        url: 'v1/user/get-contact-list',
        data: {
          page:e?e:1,
          sid:sessionStorage.getItem("party_id")
        }
      })
        .then(res => {
          if (res.data.data.code === 200) {
            console.log(res)

            this.list=res.data.data.data.info
              console.log(this.list)
              this.pageall=res.data.data.data.allPage

          } else {
            _this.$message.error('请求数据有问题！')
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    sendMsgToParent () {
      this.$emit('listenToChildExen', this.num)
    },
    handleSizeChange (val) {
      this.pageNum = val
      this.getPackData()
    },
    handleCurrentChange (val) {
      this.currentPage = val
      // this.getPackData()
      this.getData(val)
    },
    getPackData () {}
  },
  created () {
    this.currentPage = Number(localStorage.getItem('pagination')) || 1
    this.handleCurrentChange(this.currentPage)
    this.getData()
  },
  mounted () {
    this.sendMsgToParent()
  }
}
</script>

<style lang="scss" scoped>
  .pages {
    margin-top: 34px;
    margin-right: 24px;
    height: 36px;
    display: flex;
    justify-content: flex-end;
    align-items: center;

    /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
      background-color: #e60012;
    }

    /deep/ .el-icon.el-icon-arrow-left::before {
      content: '上一页';
      font-family: 'MicrosoftYaHei';
      font-size: 12px;
      font-weight: normal;
      font-stretch: normal;
      letter-spacing: 1px;
      color: #646464;
    }

    /deep/ .el-pagination .btn-prev {
      width: 80px;
    }

    /deep/ .el-pagination .btn-next {
      width: 80px;
    }

    /deep/ .el-icon.el-icon-arrow-right::before {
      content: '下一页';
      font-family: 'MicrosoftYaHei';
      font-size: 12px;
      font-weight: normal;
      font-stretch: normal;
      letter-spacing: 1px;
      color: #646464;
    }
  }
.wr {
  width: 934px;
 max-height:1007px;
  background-color: #ffffff;
  box-sizing: border-box;
  padding-top: 35px;
  overflow-x:hidden;



  .page {
    margin-bottom: 60px;
    height: 364px;
    box-sizing: border-box;

    #box {
      overflow-y: scroll;
      height: 375px;
      padding-bottom: 40px;
      box-sizing: border-box;

      &::-webkit-scrollbar {
        width: 0px;
      }

      display: flex;
      justify-content: center;
      flex-wrap: wrap;
    }

    .box {
      width: 875px;
      height: 135px;
      box-shadow: 0px 4px 18px 0px rgba(0, 0, 0, 0.15);
      border-radius: 5px;
      margin-top: 40px;
      padding: 31px 23px 32px 28px;
      box-sizing: border-box;
      position: relative;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      &:nth-of-type(1) {
        margin-top: 30px;
      }

      .iconfont {
        font-size: 23px;
        color: #fec300;
        position: absolute;
        right: 23px;
        top: 23px;
      }

      aside {
        width: 689px;
        height: 23px;
        display: flex;
        justify-content: space-between;
        align-items: center;

        .span1 {
          display: inline-block;
          width: 60%;
          font-family: 'MicrosoftYaHei';
          font-size: 22px;
          font-weight: normal;
          font-stretch: normal;
          letter-spacing: 1px;
          color: #333333;
          overflow: hidden;
          -o-text-overflow: ellipsis;
          text-overflow: ellipsis;
          white-space: nowrap;
        }

        .span2 {
          font-family: 'MicrosoftYaHei';
          font-size: 16px;
          font-weight: normal;
          letter-spacing: 1px;
          color: #999999;
        }
      }

      p {
        height: 23px;
        line-height: 23px;
        width: 100%;
        font-family: 'MicrosoftYaHei';
        font-size: 18px;
        font-weight: normal;
        font-stretch: normal;
        letter-spacing: 1px;
        color: #666666;
        overflow: hidden;
        -o-text-overflow: ellipsis;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }

    time {
      font-family: 'MicrosoftYaHei';
      font-size: 18px;
      font-weight: normal;
      font-stretch: normal;
      letter-spacing: 0px;
      color: #666666;
      display: flex;
      align-items: center;
      margin-left: 30px;

      .iconfont {
        font-size: 24px;
        margin-right: 24px;
      }
    }
  }
}
</style>
